home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / include / oldstatus.h < prev    next >
C/C++ Source or Header  |  1989-07-06  |  8KB  |  201 lines

  1. /*
  2.  * status.h --
  3.  *
  4.  *     Define the statuses that are returned from modules.
  5.  *
  6.  *    The fields of a status value are defined in the following way:
  7.  *
  8.  *    MSB                  LSB
  9.  *    +--------+----------+----------+
  10.  *    |Pub/Priv| Module # | Message #|
  11.  *    +--------+----------+----------+
  12.  *      1 bit    15 bits     16 bits
  13.  *
  14.  *    The Pub/Priv bit if 0 is used to specify that the status is
  15.  *        public and can be used by other modules.
  16.  *    The Pub/Priv bit if 1 is used to specify that the status is
  17.  *        private and can not be used by other modules.
  18.  *    The module and message numbers are used to index the message array.
  19.  *
  20.  * Copyright 1986, 1988 Regents of the University of California
  21.  * Permission to use, copy, modify, and distribute this
  22.  * software and its documentation for any purpose and without
  23.  * fee is hereby granted, provided that the above copyright
  24.  * notice appear in all copies.  The University of California
  25.  * makes no representations about the suitability of this
  26.  * software for any purpose.  It is provided "as is" without
  27.  * express or implied warranty.
  28.  *
  29.  * $Header: /sprite/src/lib/include/RCS/status.h,v 1.5 89/01/16 09:26:57 ouster Exp $ SPRITE (Berkeley)
  30.  */
  31.  
  32. #ifndef _STATUS
  33. #define _STATUS
  34.  
  35. #ifndef _SPRITE
  36. #include <sprite.h>
  37. #endif
  38.  
  39. extern char *Stat_GetMsg();
  40. extern char *Stat_GetPrivateMsg();
  41. extern void Stat_PrintMsg();
  42.  
  43. /*
  44.  * STAT_IS_PRIVATE is TRUE if the status value is private and
  45.  *     is FALSE if the status is public.
  46.  */
  47.  
  48. #define STAT_IS_PRIVATE(status)    ((status) & 0x80000000)
  49. #define STAT_MODULE(status)    (((status)& 0x7fffffff) >> 16)
  50. #define STAT_MSGNUM(status)    ((status) & 0x0000FFFF)
  51.  
  52. /*
  53.  * stat_LastError contains the result of the last failed system call (some
  54.  * library functions may also alter its value).
  55.  */
  56. extern ReturnStatus    stat_LastError;
  57. extern void           Stat_SetErrorHandler();
  58. extern void           Stat_SetErrorData();
  59. extern void        Stat_GetErrorHandler();
  60. extern ReturnStatus    Stat_Error();
  61.  
  62. /*
  63.  * The procedures below are used to map between Sprite and UNIX
  64.  * error numbers, for the interim period before Sprite converts
  65.  * over to using UNIX error numbers.
  66.  */
  67.  
  68. extern int        Compat_MapCode();
  69. extern ReturnStatus    Compat_MapToSprite();
  70.  
  71. /*---------------------------------------------*/
  72.  
  73. /*    gen.stat    */
  74. #define GEN_SUCCESS                            0x00000000
  75. #define GEN_FAILURE                            0x00000001
  76. #define GEN_ABORTED_BY_SIGNAL                  0x00000002
  77. #define GEN_NO_PERMISSION                      0x00000003
  78. #define GEN_NOT_IMPLEMENTED                    0x00000004
  79. #define GEN_INVALID_ARG                        0x00000005
  80. #define GEN_TIMEOUT                            0x00000006
  81.  
  82. /*    proc.stat    */
  83. #define PROC_BAD_FILE_NAME                      0x00010000
  84. #define PROC_BAD_AOUT_FORMAT                    0x00010001
  85. #define PROC_NO_SEGMENTS                        0x00010002
  86. #define PROC_CHILD_PROC                         0x00010003
  87. #define PROC_NO_EXITS                           0x00010004
  88. #define PROC_INVALID_PID                        0x00010005
  89. #define PROC_UID_MISMATCH                       0x00010006
  90. #define PROC_NO_CHILDREN                        0x00010007
  91. #define PROC_INVALID_FAMILY_ID                  0x00010008
  92. #define PROC_NOT_SET_ENVIRON_VAR                0x00010009
  93. #define PROC_BAD_ENVIRON_STRING                 0x0001000a
  94. #define PROC_ENVIRON_FULL                       0x0001000b
  95. #define PROC_INVALID_NODE_ID                    0x0001000c
  96. #define PROC_MIGRATION_REFUSED                  0x0001000d
  97. #define PROC_INVALID_STRING                     0x0001000e
  98. #define PROC_NO_STACKS                          0x0001000f
  99. #define PROC_NO_PEER                            0x00010010
  100.  
  101. /*    sys.stat    */
  102. #define SYS_ARG_NOACCESS                       0x00020000
  103. #define SYS_INVALID_ARG                        0x00020001
  104. #define SYS_INVALID_SYSTEM_CALL                0x00020002
  105.  
  106. /*    rpc.stat    */
  107. #define RPC_INVALID_ARG                        0x00030000
  108. #define RPC_NO_CHANNELS                        0x00030001
  109. #define RPC_TIMEOUT                            0x00030002
  110. #define RPC_TOO_MANY_ACKS                      0x00030003
  111. #define RPC_INTERNAL_ERROR                     0x00030004
  112. #define RPC_INVALID_RPC                        0x00030005
  113. #define RPC_NULL_ERROR                         0x00030006
  114. #define RPC_PARAMS_TOOBIG                      0x00030007
  115. #define RPC_DATA_TOOBIG                        0x00030008
  116. #define RPC_NO_REPLY                           0x00030009
  117. #define RPC_SERVICE_DISABLED                   0x0003000a
  118.  
  119. /*    fs.stat    */
  120. #define FS_NO_ACCESS                          0x00040000
  121. #define FS_INVALID_ARG                        0x00040001
  122. #define FS_REMOTE_OP_INVALID                  0x00040002
  123. #define FS_LOCAL_OP_INVALID                   0x00040003
  124. #define FS_DEVICE_OP_INVALID                  0x00040004
  125. #define FS_NEW_ID_TOO_BIG                     0x00040005
  126. #define FS_MASTER_CLOSED                      0x00040006
  127. #define FS_BROKEN_PIPE                        0x00040007
  128. #define FS_NO_DISK_SPACE                      0x00040008
  129. #define FS_LOOKUP_REDIRECT                    0x00040009
  130. #define FS_NO_HANDLE                          0x0004000a
  131. #define FS_NEW_PREFIX                         0x0004000b
  132. #define FS_FILE_NOT_FOUND                     0x0004000c
  133. #define FS_WOULD_BLOCK                        0x0004000d
  134. #define FS_BUFFER_TOO_BIG                     0x0004000e
  135. #define FS_IS_DIRECTORY                       0x0004000f
  136. #define FS_NOT_DIRECTORY                      0x00040010
  137. #define FS_NOT_OWNER                          0x00040011
  138. #define FS_STALE_HANDLE                       0x00040012
  139. #define FS_FILE_EXISTS                        0x00040013
  140. #define FS_DIR_NOT_EMPTY                      0x00040014
  141. #define FS_NAME_LOOP                          0x00040015
  142. #define FS_CROSS_DOMAIN_OPERATION             0x00040016
  143. #define FS_TIMEOUT                            0x00040017
  144. #define FS_NO_SHARED_LOCK                     0x00040018
  145. #define FS_NO_EXCLUSIVE_LOCK                  0x00040019
  146. #define FS_WRONG_TYPE                         0x0004001a
  147. #define FS_FILE_REMOVED                       0x0004001b
  148. #define FS_FILE_BUSY                          0x0004001c
  149. #define FS_BAD_SEEK                           0x0004001d
  150. #define FS_DOMAIN_UNAVAILABLE                 0x0004001e
  151. #define FS_VERSION_MISMATCH                   0x0004001f
  152. #define FS_NOT_CACHEABLE                      0x00040020
  153.  
  154. /*    vm.stat    */
  155. #define VM_WRONG_SEG_TYPE                     0x00050000
  156. #define VM_SEG_TOO_LARGE                      0x00050001
  157. #define VM_SHORT_READ                         0x00050002
  158. #define VM_SHORT_WRITE                        0x00050003
  159. #define VM_SWAP_ERROR                         0x00050004
  160. #define VM_NO_SEGMENTS                        0x00050005
  161.  
  162. /*    sig.stat    */
  163. #define SIG_INVALID_SIGNAL                     0x00060000
  164. #define SIG_INVALID_ACTION                     0x00060001
  165.  
  166. /*    dev.stat    */
  167. #define DEV_DMA_FAULT                          0x00070000
  168. #define DEV_INVALID_UNIT                       0x00070001
  169. #define DEV_TIMEOUT                            0x00070002
  170. #define DEV_OFFLINE                            0x00070003
  171. #define DEV_HANDSHAKE_ERROR                    0x00070004
  172. #define DEV_RETRY_ERROR                        0x00070005
  173. #define DEV_NO_DEVICE                          0x00070006
  174. #define DEV_INVALID_ARG                        0x00070007
  175. #define DEV_HARD_ERROR                         0x00070008
  176. #define DEV_END_OF_TAPE                        0x00070009
  177. #define DEV_NO_MEDIA                           0x0007000a
  178. #define DEV_EARLY_CMD_COMPLETION               0x0007000b
  179. #define DEV_NO_SENSE                           0x0007000c
  180. #define DEV_BLANK_CHECK                        0x0007000d
  181. #define DEV_BUSY                0x0007000e
  182.  
  183. /*    net.stat    */
  184. #define NET_UNREACHABLE_NET                    0x00080000
  185. #define NET_UNREACHABLE_HOST                   0x00080001
  186. #define NET_CONNECT_REFUSED                    0x00080002
  187. #define NET_CONNECTION_RESET                   0x00080003
  188. #define NET_NO_CONNECTS                        0x00080004
  189. #define NET_ALREADY_CONNECTED                  0x00080005
  190. #define NET_NOT_CONNECTED                      0x00080006
  191. #define NET_ADDRESS_IN_USE                     0x00080007
  192. #define NET_ADDRESS_NOT_AVAIL                  0x00080008
  193. #define NET_BAD_PROTOCOL                       0x00080009
  194. #define NET_BAD_OPERATION                      0x0008000a
  195. #define NET_BAD_OPTION                         0x0008000b
  196.  
  197.  
  198. /*---------------------------------------------*/
  199.  
  200. #endif /* _STATUS */
  201.